#!/bin/sh
#
# Startup script for eposd
#
# description: deamon for Epos TTS system
# chkconfig: 345 80 30
#
### BEGIN INIT INFO
# Provides: eposd
# Default-Start: 3 4 5
# Short-Description: deamon for Epos TTS system
# Description: deamon for Epos TTS system
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions


start() {
	gprintf "Starting %s:" eposd
        daemon eposd
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/eposd
	echo
	return $RETVAL
}

stop() {
        gprintf "Shutting down %s:" eposd
	killproc eposd
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/eposd
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
        ;;
  stop)
	stop
        ;;
  status)
	status eposd
	RETVAL=$?
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  condrestart)
	if [ -f /var/lock/subsys/eposd ]; then
	    stop
	    start
	    RETVAL=$?
	fi
	;;
  *)
        gprintf $"Usage: %s {start|stop|restart|condrestart|status}\n"
        exit 1
esac

exit $RETVAL
